// VisualStudioATL.cpp : Implementation of WinMain


#include "stdafx.h"
#include "Resource.h"
#include "VisualStudioATLApp.h"
#include "VisualStudioATL.h"


class CVisualStudioATLModule : public CAtlExeModuleT< CVisualStudioATLModule >
{
public :
	DECLARE_LIBID(LIBID_VisualStudioATLLib)
	DECLARE_REGISTRY_APPID_RESOURCEID(IDR_VISUALSTUDIOATL, "{D1070A54-10C6-4E67-A931-105778A241DA}")

	int WinMain(int nShowCmd) throw()
	{
		if (CAtlBaseModule::m_bInitFailed)
		{
			ATLASSERT(0);
			return -1;
		}
		HRESULT hr = S_OK;

		LPTSTR lpCmdLine = GetCommandLine(); //this line necessary for _ATL_MIN_CRT
		if (ParseCommandLine(lpCmdLine, &hr) == true)
			hr =  theApp.WinMain(nShowCmd);

	#ifdef _DEBUG
		// Prevent false memory leak reporting. ~CAtlWinModule may be too late.
		_AtlWinModule.Term();		
	#endif	// _DEBUG

		return hr;
	}
};

CVisualStudioATLModule _AtlModule;



//
extern "C" int WINAPI _tWinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, 
                                LPTSTR /*lpCmdLine*/, int nShowCmd)
{
    return _AtlModule.WinMain(nShowCmd);
}

